<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<style>
    .cls1 {
        font-size: 20px;
        color: brown;
    }

    .cls2 {
        font-size: 14px;
        color: aquamarine;
    }

    .aClass {
        font-size: 22px;
    }

    .bClass {
        color: brown;
    }
</style>
<body>

    <div id="app">
        <p :class="cls">test333333</p>
        <p :class="{aClass:isA,bClass:isB}">test4444444</p>
        <p :style="{fontSize:fontSize1}">fontSize1</p>
        <button @click="changeColor">变换字体颜色</button>
    </div>

</body>
<script src="../../public/vue.dev.js"></script>
<script>
    const vm = new Vue({
        el: '#app',
        data: {
            cls:'cls1',
            isA: false,
            isB: true,
            fontSize1:'30px'
        },
        methods:{
            changeColor(){
                this.cls = 'cls2';
                this.isA = true;
                this.isB = true;
            }
        }
    });


    /**
     * tips: 思想：html声明属性名 data写值 属性去找data data反作用于html属性
     *
     * 语法较为灵活 可动态配置
     * */
</script>
</html>